import React from 'react';
import ReactDOM from 'react-dom';
import Button from './button'
import Count from './count'
import store123 from './store/index'
import {Provider,connect} from 'react-redux'
console.log(store123.getState())
class App extends React.Component {
    constructor() {
        super();
        
    }
    render() {
      console.log(this)
        return <div className=''>
            <h1>App:{this.props.qqq}</h1>
            <Button/>
            <Count/>
        </div>;
    }
}
App = connect((state)=>{
  return {
    qqq:state.countReducer.count,
    www:state.countReducer.name,
    eee:state.countReducer.age
  }
},(dispatch)=>{
  return {
    dispatch
  }
})(App)

ReactDOM.render(<Provider store= {store123}>
{/* 使用 Provider组件 把我们的根组件抱起来之后 
  以后哪个组件 想用 redux中的数据  就直接用 connect处理即可
*/}
  <App/>
</Provider>,document.getElementById('root'))